<template>
  <div v-if="isWechat" class="wechat-mask">
    <div class="wechat-content">
      <div class="arrow-up"></div>
      1.请点击右上角 <br />
      2.点击浏览器打开
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      isWechat: false,
    };
  },
  created() {
    this.isWechat = this.isWechatBrowser();
  },
  methods: {
    isWechatBrowser() {
      const userAgent = navigator.userAgent.toLowerCase();
      return userAgent.includes("micromessenger");
    },
  },
};
</script>

<style scoped>
.wechat-mask {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5); /* 调整透明度 */
  display: flex;
  justify-content: center;
  z-index: 1000;
}
.wechat-content {
  margin-top: 20px;
  height: 80px;
  text-align: center;
  color: white;
  position: relative;
  padding: 20px;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 10px;
}
.arrow-up {
  position: absolute;
  bottom: 85%;
  left: 100%;
  margin-left: -10px;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 20px solid rgba(0, 0, 0, 0.8);
  transform: rotateZ(45deg);
}
</style>
